//
//  XLJSHandler.h
//  MiAiApp
//
//  Created by 谭启龙 on 2017/9/14.
//  Copyright © 2017年 徐阳. All rights reserved.
//  处理各种js交互

#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>

/**
 js交互回调协议
 */
@protocol ZCJSHandlerDelegate <NSObject>

/**
 js调用oc函数回调

 @param userContentController 网页
 @param message 网页回传的信息
 */
-(void)zcJsCallOCWithUserContentController:(WKUserContentController *)userContentController message:(WKScriptMessage *)message;

@end



@interface XLJSHandler : NSObject<WKScriptMessageHandler>
@property (nonatomic,weak,readonly) UIViewController *webVC;
@property (nonatomic,strong,readonly) WKWebViewConfiguration *configuration;
@property(nonatomic, weak) id<ZCJSHandlerDelegate> delegate;
-(instancetype)initWithViewController:(UIViewController *)webVC configuration:(WKWebViewConfiguration *)configuration;

-(void)cancelHandler;

@end
